<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/pages/common/head.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的订单</title>
    <style>
        h1 {
            text-align: center;
            margin-top: 200px;
        }

        td {
            color: #ef7a55;
            font-size: 20px;
        }


    </style>
</head>
<body>
<div style="width: 100%;height: 50px;
background-color: #2aabd2;
text-align: center;color: white;font-size: 26px;padding-top: 8px">
    海飞丝洗发护发用品销售系统
</div>
<div style="width: 100%;height: 50px;
background-color: rgba(95,209,232,0.71);padding: 8px;font-size: 20px">
    <a href="javascript:history.back(-1)"><span style="color: #d93535">返回上一页</span></a>
    <span style="color: #242222;font-size: 23px">|</span>
    <a href="index.jsp"><span style="color: #d93535">返回商城首页</span></a>
</div>

<div id="main">
    <table class="table table-hover" style="width: 80%">
        <tr>
            <td>时间</td>
            <td>金额</td>
            <td>状态</td>
            <td>详情</td>
        </tr>
        <c:forEach items="${sessionScope.orders}" var="i">
            <tr>
                <td>${i.createTime}</td>
                <td>${i.price}</td>
                <td>
                    <c:if test="${i.status == 0}">未发货</c:if>
                    <c:if test="${i.status == 1}">已发货，运输中</c:if>
                    <c:if test="${i.status == 2}">已签收</c:if>
                </td>
                <td>
                    <c:if test="${sessionScope.user.id == 1001}">
                        <a href="orderServlet?action=queryUsernameByOrderId&orderId=${i.orderId}
                        &status=${i.status}&m=${1}">
                            查看详情
                        </a>
                    </c:if>
                    <c:if test="${sessionScope.user.id != 1001}">
                        <a href="orderServlet?action=showOrderDetail&orderId=${i.orderId}
                        &status=${i.status}">
                            查看详情
                        </a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
    </table>
    <c:if test="${empty sessionScope.userScore}">
        <table class="table table-hover" style="width: 50%">
            <tr>
                <form method="post" action="orderServlet?action=userScore">
                    <td>请您对本商城满意度打分：</td>
                    <td><input type="radio" name="score" value="一星"/> 一星</td>
                    <td><input type="radio" name="score" value="二星"/> 二星</td>
                    <td><input type="radio" name="score" value="三星"/> 三星</td>
                    <td><input type="radio" name="score" value="四星"/> 四星</td>
                    <td><input type="radio" name="score" value="五星"/> 五星</td>
                    <td><input type="hidden" name="uid" value="${sessionScope.user.id}"/></td>
                    <td><input class="btn btn-success" type="submit" value="提交"/></td>
                </form>
            </tr>
        </table>
    </c:if>
    <c:if test="${not empty sessionScope.userScore}">
        <div style="color: #ef7a55;font-size: 20px">您对本商城的满意度评分为：${sessionScope.userScore.score}</div>
    </c:if>


</div>

</body>
</html>